<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<link href="__CSS__public.css" rel="stylesheet" type="text/css" />
<script src="__JS__jquery-1.4.2.min.js" type="text/javascript"></script>

</head>

<body>
    <script type="text/javascript">
$(window).load(function() {
	var deler = "";
	$('tr').bind('mouseover', function(){

		if(!$(this).attr('clicked')) {
			$(this).addClass('hover');
		}
	});
	$('tr').bind('mouseout', function(){
		if(!$(this).attr('clicked')) {
			$(this).removeClass();
		}
	});
	$('tr').bind('click', function(){
		if($(this).attr('clicked')) {
			$(this).removeClass();
			$(this).attr('clicked',false);
		} else {
			$(this).addClass('hover');
			$(this).attr('clicked',true);
		}
	});
	$("input[value='删除']").bind('click', function(){
		var result = $("tr[clicked=true]");
		var resultId = '';
		for (i=0; i < result.length; i++) {
			if (i==result.length-1){
				resultId += result[i].id;
			} else {
				resultId += result[i].id+",";
			}
		}
		if (result.length>0 && confirm('你非要搞掉这'+ result.length +'条记录吗？')) {
			$.ajax({
				type:'POST',
				url:'__URL__/del',
				data:{
					resultId: resultId,
				},
				cache: false,
				success: function(data) {
					alert(data);
					location.reload();
				},
			});
		}
	});
})
</script>
<div id="warp">
  <div id="titleBar">模型管理</div>
  <div class="btnBar">
    <input type="button" value="添加" onclick="window.location.href='__URL__/addtoy'" />
    <input type="button" value="删除" />
    <input type="button" value="审核" class="sh" />
    <form id="form1" name="form1" method="post" action="">
      <input type="text" name="search" id="search" />
      <input type="submit" name="search" id="search" value="搜索" />
    </form>
  </div>
  <table width="100%" border="1" cellspacing="1" cellpadding="0" class="list">
    <tr>
      <th width="6%"><a href="__URL__/manages?_order=id&_sort=<?php echo ($sort); ?>" title="<?php echo ($sortType); ?>">模型ID&nbsp;<?php if($sortImg == 'asc'): ?>↑<?php else: ?>↓<?php endif; ?></a></th>
      <th width="20%"><a href="__URL__/manages?_order=name&_sort=<?php echo ($sort); ?>" title="<?php echo ($sortType); ?>">模型名字ID&nbsp;<?php if($sortImg == 'asc'): ?>↑<?php else: ?>↓<?php endif; ?></a></th>
      <th width="10%"><a href="__URL__/manages?_order=company&_sort=<?php echo ($sort); ?>" title="<?php echo ($sortType); ?>">发行公司ID&nbsp;<?php if($sortImg == 'asc'): ?>↑<?php else: ?>↓<?php endif; ?></a></th>
      <th width="7%"><a href="__URL__/manages?_order=date&_sort=<?php echo ($sort); ?>" title="<?php echo ($sortType); ?>">发行日期ID&nbsp;<?php if($sortImg == 'asc'): ?>↑<?php else: ?>↓<?php endif; ?></a></th>
      <th width="5%">价格</th>
      <th width="5%">浏览</th>
      <th width="5%">编辑</th>
      <th width="7%">创建日期</th>
      <th width="7%">编辑日期</th>
      <th width="5%">评论</th>
      <th width="4%">推荐</th>
      <th width="9%">操作</th>
    </tr>
    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><tr id="<?php echo ($vo["id"]); ?>">
      <td><?php echo ($vo["id"]); ?></td>
      <td><a href="#"><?php echo ($vo["name"]); ?></a></td>
      <td><?php echo ($vo["company"]); ?></td>
      <td><?php echo ($vo["date"]); ?></td>
      <td><a href="#"><?php echo ($vo["price"]); ?></a></td>
      <td><?php echo ($vo["views"]); ?>次</td>
      <td><?php echo ($vo["editnum"]); ?>次</td>
      <td nowrap="nowrap" style="overflow:hidden"><?php echo ($vo["create"]); ?></td>
      <td nowrap="nowrap" style="overflow:hidden"><?php echo ($vo["update"]); ?></td>
      <td><a href="#"><?php echo ($vo["comment"]); ?>条</a></td>
      <td><?php echo ($vo["level"]); ?></td>
      <td><a href="#">编辑</a>&nbsp;|&nbsp;<a href="javascript:del('<?php echo ($vo["id"]); ?>');">删除</a></td>
    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
    
  </table>
  <div id="page"><?php echo ($page); ?></div>
</div>
</body>
</html>